package com.example.s13_jpa.repository;

import com.example.s13_jpa.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface UserRepository extends JpaRepository<User,Long>
{

    // findBy +  XXX
    User findByUserName(String userName);// where username = 'xxx'
    // findBy + XXX or YYYY
    List<User> findByUserNameOrEmail(String username,String email);// where username=? or email = ?
    // findBy + XXX + and + YYYY
    List<User> findByUserNameAndEmail(String username,String email);// where username=? and email = ?
}
